#include <iostream>

long long calc(int x, int c)
{
	long long t = 0, p = 0;;
	if (x == 0) { t = 0;  p = 0; }
	if (x == 1) { t = 0;  p = 1; }
	if (x == 2) { t = 1;  p = 2; }
	if (x == 3) { t = 3;  p = 3; }
	if (x == 4) { t = 6;  p = 4; }
	if (x == 5) { t = 10; p = 5; }
	if (x == 6) { t = 15; p = 6; }
	return t + c * p;
}

int main()
{
	int a[3];
	while(std::cin >> a[0] >> a[1] >> a[2]) {
		long long count = 0;
		for (int i = 0; i < 3; i++)
			if(a[i] > 2) { count += a[i] - 2; a[i] = 2; }
		std::cout << calc(a[0] + a[1] + a[2], count) << '\n';
	}
}
